package com.bionic.banking.core.enums;

import com.bionic.banking.core.entity.Currency;

public enum BankAccountTypeEnum {

    DEPOSIT("Deposit"), CREDIT("Credit"), CHECK("Checking"), MM("MoneyMarket");
    private final String title;

    private BankAccountTypeEnum(String t) {
        title = t;
    }

    public String format(Currency currency) {
        return title + " in " + currency;
    }

    @Override
    public String toString() {
        return title;
    }

    public static BankAccountTypeEnum parseString(String name) {
        return EnumUtil.getEnumFromString(BankAccountTypeEnum.class, name);
    }

    public static boolean contains(String name) {
        return parseString(name) != null;
    }
}
